package Ara_Dao;

import java.util.List;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import Ara_Bean.NboardBean;
import Ara_Bean.RboardBean;

public class RboardDao extends SqlMapClientDaoSupport {
	public List<?> ncommunity_notice(NboardBean nb) {
		return getSqlMapClientTemplate().queryForList("Nboard", nb);
	}
	
	public List<?> ncommunity_notice2(NboardBean nb) {
		return getSqlMapClientTemplate().queryForList("Nboard2", nb);
	}
	
	public List<?> rcommunity_notice(RboardBean rb) {
		return getSqlMapClientTemplate().queryForList("rboard", rb);
	}
	
	public List<?> Qcommunity_notice(RboardBean rb) {
		return getSqlMapClientTemplate().queryForList("Qboard", rb);
	}
	
	public Object NboardDetail(String nbno){
		return getSqlMapClientTemplate().queryForObject("nbdetail",nbno);	
		}
	
	public Object RboardDetail(String rbno){
		return getSqlMapClientTemplate().queryForObject("rbdetail",rbno);	
		}
	
	public Object QboardDetail(String rbno){
		return getSqlMapClientTemplate().queryForObject("Qbdetail",rbno);	
		}
	
	public Object RboardWriter(String rbwr){
		return getSqlMapClientTemplate().queryForObject("rbwriter",rbwr);	
		}
	
	public Object QboardWriter(String rbwr){
		return getSqlMapClientTemplate().queryForObject("Qbwriter",rbwr);	
		}
	
	public void RboardInsert(RboardBean rboardbean){
		 getSqlMapClientTemplate().insert("rbinsert", rboardbean);
		}
	
	public void NboardInsert(NboardBean Nboardbean){
		 getSqlMapClientTemplate().insert("Nbinsert", Nboardbean);
		}
	
	//게시글 수정
	public void RboardUpdate(RboardBean rboardbean){
		getSqlMapClientTemplate().update("rbupdate", rboardbean);
	}
	
	public void QboardUpdate(RboardBean rboardbean){
		getSqlMapClientTemplate().update("Qbupdate", rboardbean);
	}
	
	public void NboardUpdate(NboardBean nboardbean){
		getSqlMapClientTemplate().update("Nbupdate", nboardbean);
	}
	
	//게시글 삭제
	public void RboardDelete(int rb_no){
		getSqlMapClientTemplate().delete("rbdelete", rb_no);
	}

	public List<?> totalcount() {
		List<?> result = getSqlMapClientTemplate().queryForList("rbtotalcount");
		return result;
	}
	
	public List<?> Qtotalcount() {
		List<?> result = getSqlMapClientTemplate().queryForList("Qbtotalcount");
		return result;
	}

	//RboardcmInsert가 댓글달기 클릭했을때 넘어가는 부분
	public void RboardcmInsert(RboardBean rboardbean){
		 getSqlMapClientTemplate().insert("rbcminsert", rboardbean);
		}
	public void NboardcmInsert(NboardBean nboardbean){
		 getSqlMapClientTemplate().insert("nbcminsert", nboardbean);
		}
	
	//RboardDetail.jsp 단에 리플에 대한 리스트로 불러오는거. 게시판에 대한아이디에 대한리플을 불러오는것
	public List<?> RboardcmDetail(String rb_gno) {
		return getSqlMapClientTemplate().queryForList("rippledetail",rb_gno);
	}
	
	public List<?> QboardcmDetail(String rb_gno) {
		return getSqlMapClientTemplate().queryForList("rippledetail",rb_gno);
	}
	
	public List<?> NboardcmDetail(String nb_gno) {
		return getSqlMapClientTemplate().queryForList("Nrippledetail",nb_gno);
	}
	


}
